<% topics.each do |topic| %>
<% topic_type = Activity.find_by_id(topic.id) ? "活动帖" : "讨论帖" %>
  <div class="section">
    <div class="item">
      <h3><%=h link_to "#{topic.title}", :controller=>"topics", :action=>"show", :id=>topic.id %></h3>
      <div class="type"><%= topic_type %></div>
      <div class="description"><%=h topic.topic_content %></div>
      <div class="p">
      	<table width="500" border="0">
  	  <tr>
            <td><img src="images/starter.jpg"/><%=h topic.user.account %></td>
            <td><img src="images/time.jpg"/><%=h topic.created_at %></td>
  	  </tr>
	</table>

      </div>
    </div>
  </div>
<%end%>
<div align="center">
    <%if page > 1 %>
    <%= link_to_remote "上一页", :url=>{:controller=>"index", :action=>"last_page", :page=>page } %>
    <%end%>
    <%if topics.count == 5 %>
    <%= link_to_remote "下一页", :url=>{:controller=>"index", :action=>"next_page", :page=>page } %>
    <%end%>
</div>